<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>QZBlog</title>
    <!-- <link href="../static/css/bootstrap.css" rel="stylesheet"> -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- <link rel="stylesheet" href="../static/lib/style.css" /> -->
    <link rel="stylesheet" href="../static/lib/css/editormd.min.css"/>
    <link rel="stylesheet" href="../static/css/qz-blog.css">
    <link rel="shortcut icon" href="https://pandao.github.io/editor.md/favicon.ico" type="image/x-icon" />
</head>
<body>
    <!-- 导航 -->
    <nav class="navbar navbar-inverse navbar-static-top c-margin-bo" style="z-index: 1;">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                    <span class="sr-only"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                  </button>
                  <a class="navbar-brand c-text-color" href="../account/index.jsp" target="_blank">QZ-Bolg</a>
            </div>
            <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                <ul class="nav navbar-nav c-text-spac">
                    <li><a href="root.html"> <span class="glyphicon glyphicon-home c-icon-magrin"></span><span>首页</span></a></li>
                    <li  class="active"><a href="blogControl.html"> <span class="glyphicon glyphicon-pencil c-icon-magrin"></span><span>博客管理</span></a></li>
                    <li><a href="classifyControl.html"><span class="glyphicon glyphicon-folder-open c-icon-magrin"></span><span>分类管理</span></a></li>
                    <li><a href="tagControl.html"><span class="glyphicon glyphicon-tags c-icon-magrin"></span>标签管理</a></li>
                    <li><a href="aboutControl.html"><span class="glyphicon glyphicon-user c-icon-magrin"></span>关于我</a></li>
                </ul>
            </div>
        </div>
    </nav>
    <!-- 导航 -->
   <div class="container">
       <div class="panel panel-default c-panel-top">
           <div class="panel-heading">
                <h3 class="panel-title c-text-color">新增博客</h3>
           </div>
           <div class="panel-body">

                <form action="/addBlog.do" method="POST">
                    <div class="form-group  ">
                        <div class="col-md-12">
                            <label class="control-label sr-only" for="inputGroupSuccess1"></label>
                            <div class="input-group form-group">
                                <span class="input-group-addon">标题</span>
                                <input type="text" class="form-control input-lg" name="blog_title" id="inputGroupSuccess1" style="z-index: 1;" aria-describedby="inputGroupSuccess1Status">
                            </div>
                        </div>
                        <div class="col-md-6">
                            <select class="form-control" name="blog_classify">
                                <option value="分类">分类</option>
                                <option value="1">javas</option>
                                <option value="2">jQuery</option>
                              </select>
                        </div>
                        <div class="col-md-6">
                            <div class="form-group">
                                <label for="tags" class="sr-only">blog_tags</label>
                                <input type="text" name="blog_tags" class="form-control" id="tags" placeholder="标签">
                            </div>
                        </div>

                        <div class="col-md-12" style="z-index: 3;">
                            <div id="context-box">
                                <header>
                                    <h4 class="c-blog-title">博客内容</h4>
                                </header>
                                <div id="context">
                                    <textarea style="display:none;" name="blog_context"></textarea>
                                    </div>
                                </div>
                        </div>

                        <div class="col-md-12">
                            <h4 class="c-blog-title">博客摘要</h4>
                            <textarea name="blog_abstract" id="" cols="30" rows="6" class="form-control" placeholder="博客摘要"></textarea>
                        </div>

                        <div class="col-md-9">
                            <div class="checkbox">
                                <label>
                                    <input type="checkbox" name="blog_recommend" value="1">推荐
                                </label>
                            </div>
                            <div class="checkbox">
                                <label>
                                    <input type="checkbox" name="blog_top" value="1">置顶
                                </label>
                            </div>
                            <div class="checkbox">
                                <label>
                                    <input type="checkbox" name="blog_comm" value="1">评论
                                </label>
                            </div>
                        </div>
                        <input type="hidden" value="1" name="blog_save" id="save-state">
                        <div class="col-md-3 pull-right">
                            <button type="button" class="btn btn-default btn-lg c-addblog-btn" onclick="window.history.go(-1)">返回</button>
                            <button type="submit" class="btn btn-default btn-lg c-addblog-btn" id="save-btn">保存</button>
                            <button type="submit" class="btn btn-success btn-lg c-addblog-btn">发布</button>
                        </div>
                    </div>
                </form>
           </div>

       </div>
   </div>

    <script src="../static/js/jquery.min.js"></script>
    <script src="../static/js/bootstrap.min.js"></script>
    <script src="../static/lib/editormd.min.js"></script>
    <script type="text/javascript">
    	var contextEditor;

        $(function() {
            contextEditor = editormd("context", {
                width   : "100%",
                height  : 640,
                syncScrolling : "single",
                path    : "../static/lib/lib/"
            });
        });

        //博客发布状态，保存按钮不发布
        $(document).ready(function(){
            $("#save-btn").click(function () {
                $("form").submit(function () {
                    $("#save-state").val(0);
                });
            });
        });


    
    </script>
</body>
</html>